package com.trkj.controller;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.trkj.pojos.YzrPurchOrder;
import com.trkj.service.YzrCheckMedService;
import com.trkj.service.YzrPurchOrderService;
import com.trkj.vo.Result;

@Controller
public class YzrCheckMedController {

	@Autowired
	private YzrCheckMedService yzrCheckMedService;
	@Autowired
	private YzrPurchOrderService yzrPurchOrderService;
	
	@RequestMapping("/to_checkMed")
	public String toCheckMed(){
		return "yzr_checkMed";
	}
	
	//提交验收数据
	@RequestMapping("/submitCheckMed_yzr")
	public @ResponseBody Result submitCheckMed(String[] list,String orderId,String staffId,Date checkDate){
		yzrCheckMedService.submitCheckMed(list, orderId, staffId, checkDate);		
		return new Result(true, "提交成功！");
	}
	
	/**
	 * 查找出‘未验收’and‘未入库’的采购订单
	 */
	@RequestMapping("/queryAllOrderByNoCheck_yzr")
	public @ResponseBody Map<String,Object> queryAllOrderByNoCheck(int page, int rows){
		return yzrPurchOrderService.queryAllOrderByNoCheck(page, rows);
	}
}
